package com.mhr.ai.cr.toolWindow

import com.intellij.openapi.project.Project
import com.intellij.openapi.wm.ToolWindow
import com.intellij.openapi.wm.ToolWindowFactory
import com.intellij.ui.content.ContentFactory

/**
 * 本地 Git 工具窗口工厂类
 */
class LocalGitToolWindowFactory : ToolWindowFactory {
    
    override fun createToolWindowContent(project: Project, toolWindow: ToolWindow) {
        val localGitToolWindow = LocalGitToolWindow(project, toolWindow)
        val content = ContentFactory.getInstance().createContent(
            localGitToolWindow.getContent(), 
            "本地变更", 
            false
        )
        toolWindow.contentManager.addContent(content)
    }
    
    override fun shouldBeAvailable(project: Project) = true
}